home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 November
/
EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso
/
earcd
/
util
/
text
/
frexxedv.lha
/
FrexxEdpatch
/
fpl
/
FillText.FPL
< prev
next >
Wrap
Text File
|
1995-09-12
|
2KB
|
70 lines
// $Id: FillText.FPL 1.1 1995/09/12 15:30:48 jskov Exp $
// $VER: FillText.FPL 1.0 (12.09.95) © Jesper Skov
//»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» fillText ««
export void fillText()
{
if (ReadInfo("line_length")==1){
ReturnStatus("Place cursor in a paragraph!");
return;
}
Visible(0);
// Find topmost line
while((ReadInfo("line_length")>1) && ReadInfo("line")>1)
CursorUp();
if(ReadInfo("line")!=1)
CursorDown();
CursorDown();Home();
// Put all lines in paragraph on same line
while(ReadInfo("line_length")>1){
Backspace();Output(" ");
CursorDown();Home();
}
CursorUp();
// Delete leading spaces
while(Isspace(GetChar()))
Delete();
BlockMark(0);
BlockMarkLine(-1);
Replace(1,"\t"," ","=bf+"); // replace tabs with space
Home();
Replace(1," +"," ","=bfw+"); // replace multiple spaces with space
Home();
if(ReadInfo("fill_text_US")){ // if wanted, set US double space
Replace(1,". ",". ","=bf+");
Home();
}
BlockMark(0);
// Now split line up in valid sized single lines
while(GotoLine(ReadInfo("line"),ReadInfo("wall_right"))){
// If a word is crossing the wall_right, go left of it.
if(!Isspace(GetChar(ReadInfo("byte_position")-1))){
CursorLeftWord();
if (ReadInfo("column")==1) // very long word!
CursorRightWord(); // simply go back!
}
Backspace();
if (Isspace(GetChar(ReadInfo("byte_position")-1)))
Backspace(); // clear extra for US .
Output("\n");
}
// Delete last space there may be after a .
if(Isspace(GetChar(ReadInfo("byte_position")-1)))
Backspace();
Visible(1);RedrawScreen();
}
//»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» Info vars ««
ConstructInfo("fill_text_US","","","WBG(display)","",0,1,0);